<template>
	<view class="container">
		<!-- <rich-text :nodes="detail.content"></rich-text> -->
		<u-parse :content="detail.content" @preview="preview" @navigate="navigate" ></u-parse>
	</view>
</template>

<script>
	import uParse from '@/components/u-parse/u-parse.vue'

	import { Agreement } from '@/utils/model/agreement-model.js';
	var agreement = new Agreement();
	
	export default{
		components: {
		    uParse
		},
		data() {
			return {
				id: 0,
				detail:{}
			}
		},
		onLoad(options) {
			let id = options.id;
			agreement.getDetail(id).then(res => {
				console.log(res.data.detail.content)
				this.detail = res.data.detail
				uni.setNavigationBarTitle({
					title: this.detail.title
				})
			})
			.catch(err => {
			})
		}

	}
</script>

<style lang="scss" scoped>
	@import url("@/components/u-parse/u-parse.css");
	.container {
		width: 100%;
		min-height: 100vh;
		padding: 20rpx;
		box-sizing: border-box;
		background: #fff;
	}
</style>
